package com.competition.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.competition.dao.UserDao;
import com.competition.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select(" SELECT user.`user_name`,user.`user_avatar`,user.`user_id` FROM USER,role WHERE user.`user_id` = role.`user_id` AND role.`role_id` = #{roleID}")
    List<UserDao> getAllByRole(@Param("roleID")String roleID);
}
